Skip to content

fix(service-settings): remove legacy buildAuditSink that wrote to sys_audit_log with wrong columns#2017

Merged
os-zhuang merged 1 commit into
mainfrom
worktree-agent-ab3b0130950f60cf9
Jun 18, 2026
Merged

fix(service-settings): remove legacy buildAuditSink that wrote to sys_audit_log with wrong columns#2017
os-zhuang merged 1 commit into
mainfrom
worktree-agent-ab3b0130950f60cf9

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Summary

  • buildAuditSink in SettingsServicePlugin was inserting into sys_audit_log with columns that don't exist on that table (actor_id, entity_type, entity_id, payload, occurred_at). This caused a SqliteError on every settings write, caught silently and emitted as a WARN SettingsServicePlugin: audit record failed log.
  • The Phase 3 buildAuditWriter (already wired in the same bindEngine call) correctly writes to sys_setting_audit with the proper schema.
  • Fix: remove buildAuditSink entirely and pass undefined for the legacy audit sink slot.

Root cause

The sys_audit_log object schema defines user_id (not actor_id) and has no entity_type, entity_id, payload, or occurred_at columns. buildAuditSink was written before sys_setting_audit existed and was never updated when Phase 3 introduced the dedicated table.

Test plan

  • Boot examples/app-crm and write a setting via the Setup UI — confirm no WARN SettingsServicePlugin: audit record failed in the console
  • Confirm sys_setting_audit rows are written correctly after a settings save

🤖 Generated with Claude Code

…_audit_log with wrong columns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 18, 2026 3:42am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): packages/services.

5 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/guides/packages.mdx (via packages/services)
  • content/docs/guides/runtime-services/audit-service.mdx (via packages/services)
  • content/docs/guides/runtime-services/index.mdx (via packages/services)
  • content/docs/guides/runtime-services/settings-service.mdx (via packages/services)
  • content/docs/protocol/objectos/i18n-standard.mdx (via packages/services)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@os-zhuang
os-zhuang merged commit 2e8bd83 into main Jun 18, 2026
13 of 14 checks passed
@os-zhuang
os-zhuang deleted the worktree-agent-ab3b0130950f60cf9 branch June 18, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant